//
//  YCAudioStreamer.h
//  YCSchool
//
//  Created by Yanglixia on 16/5/15.
//  Copyright © 2016年 yanglinxia. All rights reserved.
//

#import <Foundation/Foundation.h>
@class YCAudioStreamer;

@protocol YCAudioStreamerDelegate <NSObject>

@optional

- (void)audioStramer:(YCAudioStreamer *)stramer didPlayingWithProgress:(float)progress;
- (void)audioStramerDidFinishPlaying:(YCAudioStreamer *)streamer;
- (void)audioStramerStartPlay;
- (void)audioStramerFinishPlay;

@end


@interface YCAudioStreamer : NSObject


@property (nonatomic, assign) float volume;// 播放器的音量

@property (nonatomic, assign) id<YCAudioStreamerDelegate> delegate;

@property (nonatomic, assign) float totalTime;
@property (nonatomic, assign) float currentTime;

@property (nonatomic, copy)NSString *url;
@property (nonatomic, copy)NSString *add_time;

@property (nonatomic, assign)NSInteger tag;

// 单例方法
+ (instancetype)sharedStreamer;

// 播放、暂停、停止
- (void)play;

- (void)pause;

- (void)stop;

// 设置音频的URL

- (void)setAudioMetadataWithURL:(NSString *)urlString;

- (void)seekToTime:(float)time;// 跳转到指定的时间播放

- (BOOL)isPlaying;// 判断是否正在播放
- (BOOL)isPrepared;// 判断是否准备完成
- (BOOL)isPlayingCurrentAudioWithURL:(NSString *)urlString;// 判断是否正在播放指定的URL

//把时间改成字符串
+ (NSString *)timeWithInteger:(NSInteger)time;



@end
